import {secAdd,secList,secOne,secUpdate,secDel} from "../../request/api"
import { successAlert } from "../../utils/alert"
const state={
    sec:[]
} 
const mutations={
    changeSec(state,res){
        state.sec=res;
    }
}
const actions={
    secListActions(context){
        secList().then(res=>{
            if(res.code===200){
                context.commit("changeSec",res.list)
            }
        })
    },
    secUpdateActions(context,data){
        secUpdate(data).then(res=>{
            if(res.code===200){
                successAlert("修改成功")
            }
        })
    }
}
const getters={
    sec(state){
        return state.sec;
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced:true
}